package com.office.service.impl;

import com.office.bean.Emp;
import com.office.bean.EmpManger;
import com.office.bean.TDepart;
import com.office.mapper.Mapper;
import com.office.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class EmpServiceimpl implements EmpService {
    @Autowired
    Mapper mapper;
    @Override
    public Emp findAllEmp(Emp emp) {
        Emp allEmp = mapper.login(emp);
        return allEmp;
    }

    @Override
    public List<EmpManger> findDepartAndEmp(int empid, int departid) {
        return mapper.findDepartAndEmp(empid, departid);
    }

    @Override
    public int findallcoutEmp() {
        return mapper.findallcoutEmp();
    }

    @Override
    public List<EmpManger> findempBypage(Map<String, Object> map) {
        return mapper.findempBypage(map);
    }

    @Override
    public List<TDepart> finddeparts() {
        return mapper.finddeparts();
    }

    @Override
    public boolean addemp(Emp emp) {
        return mapper.addemp(emp);
    }

    @Override
    public boolean updateflag(int id, int flag) {
        return mapper.updateflag(id,flag);
    }

    @Override
    public List<Integer> findMajorAndEmpAllcount() {
        return mapper.findMajorAndEmpAllcount();
    }
}
